package com.paziy.jan.graphics.figures;

import com.paziy.jan.graphics.Color;

public class Rectangle extends Point {

    private static final int DEFAULT_HEIGHT = 1;
    private static final int DEFAULT_WIDTH = 1;

    private int width = DEFAULT_WIDTH;
    private int height = DEFAULT_HEIGHT;

    public Rectangle() {
        super();
    }

    public Rectangle(int x, int y, int height, int width) {
        super(x, y);
        setHeight(height);
        setWidth(width);
    }

    public Rectangle(int x, int y, int height, int width, Color color) {
        super(x, y, color);
        setHeight(height);
        setWidth(width);
    }

    public void setHeight(int newHeight) {
        height = newHeight;
    }

    public void setWidth(int newWight) {
        width = newWight;
    }

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    @Override
    public void draw() {
        System.out.println(toString());
    }

    @Override
    public String toString() {
        return "Rectangle: x: " + getX() + "; y: " + getY() + "; Height: " + height + "; Width: " + width +
                "; " + getColor() + ";";
    }
}
